<#assign module="news"/>

<@override name="header">
<link rel="stylesheet" href="${ctx}/assets/css/bootstrap-multiselect.css">
<link rel="stylesheet" href="${ctx}/assets/css/datetimepicker.css">
<style>
	.input-query-multiple{
		min-width: 300px;
	    padding: 0px 0px;
	    height: auto;
	    margin-top: 20px;
	}
</style>
</@override>
<@override name="body">
<div class="row">
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading">
               	 编辑广告
            </div>
            <div class="panel-body">
                <form id="submit_form" action="${ctx}/news/updateNews" class="form-horizontal" method="post">

			      <input type="hidden" name="id" value="${noticeNews.id}"/>
				  <div class="form-group">
						<label class="col-sm-3 control-label"><em>*</em>是否置顶:</label>
	                    <div class="col-sm-3">
	                    	<label>
							  <input type="radio" name="status" value="2" <#if noticeNews.status==2> checked </#if> />是
							</label>
							&nbsp;&nbsp;&nbsp;
							<label>
							  <input type="radio" name="status" value="1" <#if noticeNews.status==1> checked </#if> />否
							</label>
						</div>
					</div>
					
					<@shiro.isMainCompany>
						<#if companys?exists> 
							<div class="form-group">
								<label class="col-sm-3 control-label"><em>*</em>选择公司:</label>
								<div class="col-sm-3">
									<select class="form-control" id="companyId" name="companyId">
										<option value="">--无--</option>
										<#list companys as company>
											<option <#if noticeNews.companyId?? && noticeNews.companyId == company.id>selected="selected"</#if> value="${company.id}">${company.companyName}</option>
										</#list>
									</select>
								</div>
							</div>
						</#if> 
					</@shiro.isMainCompany>
					
					<div class="form-group">
						<label class="col-sm-3 control-label"><em>*</em>服务类型:</label>
						<div class="col-sm-3">
							<select class="form-control" id="serviceType" name="serviceType">
								<option value="">--无--</option>
								<#if appKey == "2b908a6aeec543c5abdf20a070bdeb86">
                                <option value="shouye" <#if noticeNews.serviceType?? && noticeNews.serviceType == "shouye">selected="selected"</#if>>首页</option>
								</#if>
									<@pao>
								<option value="pao" <#if noticeNews.serviceType?? && noticeNews.serviceType == "pao">selected="selected"</#if>>跑腿</option>
								</@pao>
								<@daijia>
								<option value="daijia" <#if noticeNews.serviceType?? && noticeNews.serviceType == "daijia">selected="selected"</#if>>代驾</option>
								</@daijia>
								<@zhuan>
								<option value="zhuan" <#if noticeNews.serviceType?? && noticeNews.serviceType == "zhuan">selected="selected"</#if>>专车</option>
								</@zhuan>
								<@freight>
								<option value="freight" <#if noticeNews.serviceType?? && noticeNews.serviceType == "freight">selected="selected"</#if>>货运</option>
								</@freight>
								<@zu>
								<option value="zu" <#if noticeNews.serviceType?? && noticeNews.serviceType == "zu">selected="selected"</#if>>租车</option>
								</@zu>
								<@gasstation>
								<option value="gasstation" <#if noticeNews.serviceType?? && noticeNews.serviceType == "gasstation">selected="selected"</#if>>加油站</option>
								</@gasstation>
								<@zhuanxian>
								<option value="zhuanxian" <#if noticeNews.serviceType?? && noticeNews.serviceType == "zhuanxian">selected="selected"</#if>>快车</option>
								</@zhuanxian>
							</select>
						</div>
					</div>
					
					<div class="form-group">
						<label class="col-sm-3 control-label"><em>*</em>终端类型:</label>
						<div class="col-sm-3">
							<select class="form-control" id="contType" name="contType">
								<option value="">--无--</option>
								<@weixin>
								<option value="weixin" <#if noticeNews.contType?? && noticeNews.contType == "weixin">selected="selected"</#if>>微信公众号</option>
								</@weixin>
								<option value="app" <#if noticeNews.contType?? && noticeNews.contType == "app">selected="selected"</#if>>APP</option>
							</select>
						</div>
					</div>
										
                    <div class="form-group">
                        <label class="col-sm-3 control-label"><em>*</em>广告标题:</label>
                        <div class="col-sm-3">
                            <input class="form-control" type="text" id="title" name="title" value="${noticeNews.title}" />
                        </div>
                    </div>
                
                    <div class="form-group">
                        <label class="col-sm-3 control-label"><em>*</em>广告作者:</label>
                        <div class="col-sm-3">
                            <input class="form-control" type="text" id="author" name="author" value="${noticeNews.author}"/>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label class="col-sm-3 control-label"><em>*</em>发布时间:</label>
                         <div class="col-sm-3">
                            <input class="form-control" type="text" id="created" name="created" value="${created}"/>
                        </div>
                    </div>
                    
                    <div class="form-group">
                        <label class="col-sm-3 control-label"><em>*</em>广告链接:</label>
                         <div class="col-sm-3">
                            <input class="form-control" type="text" id="link" name="link" value="${noticeNews.link!}" placeholder=""/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-3 control-label"><em>*</em>广告导图:</label>
                        <div>
                            <label <span style="color:red;">提示：建议大小：700 x 128 &nbsp;&nbsp;比例：11 : 2</span></label>
						<#--<button type="button" id="picture_upload_dialog" class="area-edit col-sm-1  button button-pill button-flat-primary button-tiny">-->
						<#--<i class="glyphicon glyphicon-open"></i>&nbsp;图片上传</button>-->
                            <p><input type="file" name ="image" id="image" class="glyphicon glyphicon-open"></input></p>
                        </div>
                    </div>
                    <#--<div class="form-group">-->
                    	<#--<label class="col-sm-3 control-label"><em>*</em>广告导图:</label>-->
                    	<#--<div class="col-sm-6">-->
                            <#--<img id="picture_img" width="400px;" height="200px;" src="${noticeNews.image}"/>-->
                            <#--<input style="display:none;" type="file" name="pic1" id="picture_file" accept=".bmp,.gif,.jpeg,.jpg,.png">-->
                            <#--<input type="hidden" id="picture" name="image" value="${noticeNews.image}">-->
	                    <#--</div>-->
                    <#--</div>-->
                    
					<div class="form-group">
	                    <label class="col-sm-3 control-label"><em>*</em>广告内容：</label>
	                    <div class="col-sm-6">
							<textarea class="form-control" id="content" name="content"  rows="8">${noticeNews.content}</textarea>
		                    <span class="word_count1"></span>
		                    <span class="word_count2"></span>
		                    <span class="word_surplus"></span>
	                    </div>
	                </div>
					<div class="form-group">
                        <label class="col-sm-6 control-label">温馨提示：请输入广告正文(可以输入作者、插图、发布日期、详细文字等信息)</label>
                    </div>
                    
                    <div class="form-group" style="margin-left:10px;">
                        <label class="col-sm-3 control-label"></label>
                        <input id="submit_button" type="button" class="btn btn-primary" value="修改">
                        <input type="button" class="btn btn-default" onclick="window.location.href = '${ctx}/news/list';" value="返回">
                    </div>

                </form>
            </div>
        </div>
    </div>
</div>
</@override>
<@override name="footer">
<script src="${ctx}/assets/js/bootstrap-multiselect.js"></script>
<script src="${ctx}/assets/js/ajaxfileupload.js"></script>
<script src="${ctx}/assets/kindeditor/kindeditor-all-min.js"></script>
<script src="${ctx}/assets/kindeditor/lang/zh_CN.js"></script>
<script src="${ctx}/assets/js/datepicker.js"></script>
<script src="${ctx}/assets/js/news/edit.js"></script>
</@override>
<@extends name="../layout.ftl"/>
